<!DOCTYPE html>
<html lang="en" xmlns:th="http://www.thymeleaf.org">
<head>
    <meta charset="UTF-8">
    <title>Title</title>
</head>
<body>

<form th:action="@{/add}" method="post">
    <div class="form-group">
        <label>LastName</label>
        <input name="lastName" value="tom" type="text" class="form-control" id="exampleInputEmail1"
               placeholder="lastName">
    </div>

    <div class="form-group">
        <label>Email</label>
        <input name="email" value="123456@qq.com" type="email" class="form-control" id="exampleInputPassword1"
               placeholder="email">
    </div>

    <div class="form-group">
        <label>Gender</label>
        <div class="form-check form-check-inline">
            <input class="form-check-input" type="radio" value="1" name="gender"/>
            <label class="form-check-label">男</label>
        </div>
        <div class="form-check form-check-inline">
            <input class="form-check-input" type="radio" value="0" name="gender"/>
            <label class="form-check-label">女</label>
        </div>
    </div>

    <div class="form-group">
        <label>Department</label>
        <!--提交的Department的是部门id-->
        <select name="department.id" class="form-control">
            <option th:each="dept:${departments}"
                    th:text="${dept.getDepartmentName()}"
                    th:value="${dept.getId()}"></option>
        </select>
    </div>

    <div class="form-group">
        <label>Birth</label>
        <input name="birth" value="2020-5-27" type="text"
               class="form-control"
               placeholder="yyyy-MM-dd">
    </div>
    <button type="submit" class="btn btn-default">添加</button>
</form>

</body>
</html>